package model.conversations;

import java.util.HashMap;

import exceptions.InvalidConversationNumber;


public class ConversationStorage {

	String key;
	private HashMap<String,Conversation> conversationStore;
	Conversation currentConv;
	
	public ConversationStorage(){
	
	conversationStore = new HashMap<String,Conversation>();

	Conversation aaron1 = new Conversation("aaron1","Hi lad what can I do for ye?");
	
	/*
	aaron1.setReply("Greetings messanger boy","INITIAL",false,true);
	aaron1.setReply("You speak strangely boy. Explain yourself.","UNIDENTIFIED",false,false);
	aaron1.setReply("Thats enough. now tell me why you are here","REPEAT",false,true);
	aaron1.setReply("Thank you lad, now tell me why you are here","HAIL HELLO: SIR LORD MERCANI",false,true);
	aaron1.setReply("Alas, it is unfortunate that you come with this request at this grievous time.","MESSAGE",true,true);
	aaron1.setReply("A convoy of armaments protected by my knights was heading towards the Court of Dencaster, ",null,true,true);
	aaron1.setReply("when it was ambushed last night by a Fyr rading party near the Cursed Forest. ",null,true,true);
	aaron1.setReply("The attack took two my knights to the death and several more wounded. ",null,true,true);
	aaron1.setReply("I needest t'remaining able bodied knights to protect this estate. ",null,true,true);
	aaron1.setReply("Luckily, I can spare a Knight for the King. ",null,true,true);
	aaron1.setReply("Take with thee the valiant Sir Gillead. You will find him in the house to the west of the Courtyard.",null,true,true);
	*/
	
	conversationStore.put("aaron1",aaron1);
	/*
	Conversation gillead1 = new Conversation();
	gillead1.setReply("Instead of talking, let us be on our way","A",true,true);
	conversationStore.put("gillead1",gillead1);
	
	Conversation gillead2 = new Conversation();
	gillead2.setReply("Let us make haste to the Royal Court","s",true,true);
	conversationStore.put("gillead2",gillead2);
	
	Conversation gillead3 = new Conversation();
	gillead3.setReply("A good friend of mine died from the ambush laid by the cursed Fyr. Damn them.","F",true,true);
	conversationStore.put("gillead3",gillead3);
	*/
	}
	
	public void setConversation(Conversation c){
		conversationStore.put(c.name, c);
	}
	public Conversation getConversation (String key)throws InvalidConversationNumber{
		if(!conversationStore.containsKey(key))
			throw new InvalidConversationNumber();
			currentConv = conversationStore.get(key);
			return currentConv;
	}
}
